<?php

// connect
require 'connect.php';

// Create database
if (mysql_query("CREATE DATABASE lyubishchev",$con))
  {
  echo "Database created <br>";
  }
else
  {
  echo "Error creating database: " . mysql_error() . "<br>";
  }

//Create table in database
mysql_select_db("lyubishchev", $con);

$sql = "CREATE TABLE Log
(
ID int NOT NULL AUTO_INCREMENT, 
PRIMARY KEY(ID),
start 	datetime,
end 	datetime,
mainclass 	varchar(15),
subclass	varchar(15),
description varchar(140)
)";

if (mysql_query($sql,$con)) {
	echo "Table created <br>";
} else {
	echo "Error creating table: " . mysql_error() . "<br>";
}

mysql_close($con);

echo "if ther is no error. <a href='index.html'>Please use it</a>";
?>